package com.gexin.model.user;

import com.gexin.common.utils.SQLUtils;
import com.gexin.model.user.base.BaseUserRebate;
import com.gexin.model.weixin.WeixinUser;
import com.jfinal.plugin.activerecord.Page;

/**
 * 业务名称:  t_user_rebate(用户返利表) 
 */
@SuppressWarnings("serial")
public class UserRebate extends BaseUserRebate<UserRebate> {
	public static final UserRebate dao = new UserRebate();
	/**状态 提现*/
    public static final Integer STATUS_TIXIAN = 0;
    /**状态 收入*/
    public static final Integer STATUS_SHOURU = 1;

    /**提现状态申请*/
    public static final Integer STATE_SQ = 0;
    /**提现状态成功*/
    public static final Integer STATE_CQ = 1;
    /**提现状态失败*/
    public static final Integer STATE_SB= 2;

    public Page<UserRebate> findPageList(Integer page, Integer pageSize, WeixinUser authUser, Integer state) {
        SQLUtils sqlUtils = new SQLUtils();
        sqlUtils.append(" from t_user_rebate where user_id=?");
        if(state!=null){
            sqlUtils.whereEquals("state",state);
        }
        return paginate(page,pageSize,"Select * ",sqlUtils.toString(),authUser.getId());
    }
}
